module shader.matshadertriidx;

import shader.abstractshader;
import scene.scene;
import scene.ray;
import scene.intersection;
import utils.color;

class MatShaderTriIdx: AbstractShader {
    public void getColor(inout Ray ray, inout Intersection inters,
        inout RGBColor col)
    {
        col.r = col.g = col.b = (cast(float)inters.triIdx)/mScene.triCount();
    }

    public char[] toString() {
        return "Triangle index";
    }
}
